home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / zbpc_460.zip / TUTOR.EXE / ARRAYS.DOC next >
Text File  |  1988-11-13  |  1KB  |  33 lines

  1.         ZBASIC Arrays
  2. ...
  3. There are some differences in how arrays are handled in ZBASIC.
  4. First there is an additional option in the DIM statement for
  5. String Arrays. The maximum length of the string can be defined
  6. in the DIM statement (if a string of greater length is moved into
  7. a position the string is truncated to that length).
  8. ...
  9. Thus DIM50A$(100) would limit string length in A$(X) to 50 bytes.
  10. This can yield substantial memory savings.
  11.  
  12. ZBASIC also has a special array called INDEX$. There are several
  13. commands available within INDEX$.
  14. ...
  15. Data can be assigned as normal, i. e. INDEX$(3) = "DATA", ALSO...
  16. ...
  17. The values of all positions in INDEX$ can be reset with 
  18. CLEAR INDEX$.
  19. ...
  20. Data can be inserted with INDEX$ I(20)="DATA". This would not
  21. only set position 20 to that data, but move all previous data
  22. from the old position 20 up one position.
  23. ...
  24. Data can be deleted with INDEX$ D(20). This would not only delete
  25. position 20, but move all previous data from the old position 21
  26. down one position.
  27. ...
  28. Data can be located in INDEX$ with X=INDEXF("DATA"). If the data
  29. is not found, X will contain -1, otherwise X will contain the
  30. position in INDEX$ where the data is located. Another option is to
  31. start at a specific location by X=INDEXF("DATA",10). "Wild-carding"
  32. is supported in that INDEXF("CHR") will match CHRIS.
  33.